<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/2
  Time: 19:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>留言</title>
		<!--<%--<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css">--%>-->

		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css">
		<link href="${pageContext.request.contextPath}/css/base.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/css/index.css" rel="stylesheet">
		<!--<link rel="stylesheet" href="../../css/style.css">-->
		<style type="text/css">
			body {
				background: #F5F5F5;
			}
			
			ul.dropdown-menu {
				background: black;
			}
			
			ul.dropdown-menu li a {
				color: white;
			}
			
			.item img {
				margin: 0 auto;
			}
			
			.carousel {
				position: relative;
				top: 10px;
			}
			
			.navbar-fixed-top {
				top: 0;
				border-width: 0 0 1px;
				right: 15px;
				left: 15px;
			}
			
			.ph {
				position: relative;
				bottom: 10px;
				box-shadow: 0px 2px 2px 0px #CCC;
			}
			
			.one {
				position: relative;
				top: 30px;
			}
			
			.dvhp {
				position: relative;
				top: 500px;
				left: 200px;
			}
			
			.tab1 {
				position: relative;
				top: 20px;
			}
			

			
			.foot {
				position: relative;
				top: 450px;
				background: #222222;
			}
			.mes{
				height: 100px;
				width: 1000px;
			}
			.messagediv{
				position: relative;
			}
			.subButdiv{
				position: relative;
				top: 10px;
			}
		</style>
	</head>

	<body>
		<div class="container-fluid">
			<!--导航条begin-->
			<div role="navigation" class="navbar navbar-default navbar-fixed-top" role="navigation" id="menu-nav">
				<div class="container">
					<div class="navbar-header">

						<a class="navbar-brand" href="#">凡一个人博客</a>
					</div>
					<div class="navbar-collapse collapse">
						<ul class="nav navbar-nav">
							<li>
								<a href="${pageContext.request.contextPath}/admin/articleIndexView">首页</a>
							</li>
							<li>
								<a href="${pageContext.request.contextPath}/admin/showArticleView">文章</a>
							</li>
							<li>
								<a href="${pageContext.request.contextPath}/admin/aboutFyiView">关于我</a>
							</li>
							<li class="dropdown">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">MORE <span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li>
										<a href="#feature-tab" data-tab="tab-chrome">随笔</a>
									</li>
									<li>
										<a href="#feature-tab" data-tab="tab-safari">心得笔记</a>
									</li>
									<li class="active">
										<a href="#feature-tab" data-tab="tab-opera">MessggeForMe</a>
									</li>
									<li>
										<a href="${pageContext.request.contextPath}/admin/superAdminLoginView">登录后台</a>
									</li>
									<li>
										<a href="${pageContext.request.contextPath}/" data-tab="tab-ie">log out</a>
									</li>
								</ul>
							</li>
							<li>
								<a href="${pageContext.request.contextPath}/admin/technicalExchangeView">技术交流</a>
							</li>
							<li>
								<a href="#" data-toggle="modal" data-target="#about-modal">项目合作</a>
							</li>
						</ul>
						<form class="navbar-form navbar-right">
							<div class="form-group">
								<input type="text" class="form-control" placeholder="Search">
							</div>
							<button type="submit" class="btn btn-default">搜索</button>
						</form>

						<!--<button type="button" class="btn btn-danger navbar-btn">
							<span class="glyphicon glyphicon-off"></span> 退出登录
					</button>-->
					</div>
				</div>
			</div>
			<!--导航条end-->
			<!--轮播图begin-->
			<div id="myCarousel" class="carousel slide">

				<div class="carousel-inner one">
					<div class="item active" style="background:#D3D6CF;">
						<img src="${pageContext.request.contextPath}/images/bbb.jpg" alt="第一张">
						<!--<%--<img src="${pageContext.request.contextPath}/images/lb5.jpg" alt="第一张">--%>-->
					</div>

				</div>

			</div>
			<!--轮播图end-->
			<!--内容部分begin-->

			<div class="tab1">
				<div class="container">
					<div class="row">
						<div class="tab2">
							<h3 align="left">畅言一下</h3>
							<form id="messageBut">
								<label for="messageContent" class="col-sm-2 control-label"></label>
								<div class="messagediv">
										<textarea class=" mes" id="messageContent" name="messageContent"  placeholder="说点什么......"></textarea>
									</div>
									<div class="subButdiv">
										<button type="button" class="btn btn-info subBut">发表</button>
									</div>
							</form>
						</div>

					</div>
				</div>
			</div>


			<!--内容部分end-->
		</div>
		<!--页脚begin-->
		<div class="foot">
			<footer id="footer">
				<div class="container">
					<p>凡一博客 | 合作事宜 | 版权投诉</p>
					<p>鄂ICP 备01240520. © 2018-2019 FYI IT凡一. Powered by Bootstrap.</p>
				</div>
			</footer>
		</div>
		<!--页脚end-->
		<script src="${pageContext.request.contextPath}/backstatic/assets/plugins/jquery/jquery.min.js"></script>
		<!-- Bootstrap popper Core JavaScript -->
		<!-- slimscrollbar scrollbar JavaScript -->
		<script src="${pageContext.request.contextPath}/backstatic/js/perfect-scrollbar.jquery.min.js"></script>
		<!--Wave Effects -->
		<!--Menu sidebar -->
		<!--Custom JavaScript -->
		<!-- ============================================================== -->
		<!-- This page plugins -->
		<!-- ============================================================== -->
		<script src="${pageContext.request.contextPath}/backstatic/assets/plugins/chartist-js/dist/chartist.min.js"></script>

		<script type="text/javascript">
		$(function () {
			/*添加*/
			$("body").on("click", ".subBut", function() {
				console.log($("#messageBut").serialize());
				$.ajax({
					type: "POST",
					url: "${pageContext.request.contextPath}/message/addMessage",
					data: $("#messageBut").serialize(),
					/*data:JSON.stringify({messageContent:messageContent}),*/
					dataType: "json",
					success: function(data) { /*执行成功*/
						console.log(data);
						if(data.code == 200) {
							//刷新页面
							window.location.reload();
						}
						alert(data.msg);
					},
					error: function() { /*执行失败*/
						alert("留言失败，请先登录！");
					}
				});
			});
		})
	</script>
	</body>
	<script src="${pageContext.request.contextPath}/js/jquery.js" type="text/javascript" charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<!--<script src="../../js/jquery.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>-->

</html>